package com.pro.service.imple;

import com.pro.mapper.JsDeptAuthorityMapper;
import com.pro.pojo.JsDeptAuthority;
import com.pro.service.JsDeptAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 祖铭泽
 * @Date 2021/11/27/0027
 * @description 部门权限 业务层
 */
@Service
public class JsDeptAuthorityServiceImple implements JsDeptAuthorityService {
    @Autowired
    private JsDeptAuthorityMapper jsDeptAuthorityMapper;
    //添加部门时将此部门拥有的权限添加到部门权限表
    @Override
    public boolean addJsDeptAuthority(JsDeptAuthority jsDeptAuthority) {
        return jsDeptAuthorityMapper.addJsDeptAuthority(jsDeptAuthority);
    }
    //根据部门id查询当前部门所有权限
    @Override
    public List<JsDeptAuthority> getAuthoritysByDeptId(Integer deptId) {
        return jsDeptAuthorityMapper.getAuthoritysByDeptId(deptId);
    }

    @Override
    public boolean delDeptAuthorityByDeptId(Integer deptId) {
        return jsDeptAuthorityMapper.delDeptAuthorityByDeptId(deptId);
    }
}
